/*
 * Created by Christopher King
 * Copyright (C) 2007 Christopher King, All Rights Reserved.
 */

package us.cirion.adventure.engine.result;

import us.cirion.adventure.engine.Player;
import us.cirion.adventure.engine.Result;
import us.cirion.adventure.engine.Room;

/**
 * Moves the player to a specified location. Note that this Result is only
 * required for warp-style movement where the player is suddenly transported to
 * another location as the result of a special event or condition. Normal
 * movement through the world in response to explicit player commands is handled
 * directly by the game.
 * 
 * @author Chris
 */
public class SetPlayerLocation implements Result
{

	private Room newLocation;
	private Player player;

	/**
	 * Constructs a new command to move the player.
	 * 
	 * @param player
	 * @param newLocation
	 */
	public SetPlayerLocation(Player player, Room newLocation)
	{
		this.player = player;
		this.newLocation = newLocation;
	}

	/**
	 * Moves the player.
	 */
	public void execute()
	{
		player.setCurrentLocation(newLocation);
	}

}
